package com.example.hyg_veintype.constant.account;

import android.content.Context;
import android.text.TextUtils;

import com.example.hyg_veintype.activity.account.register.RegisterActivity;
import com.example.hyg_veintype.utils.SPUtil;

/**
 * @author: yyw
 * time: 2020/12/23 17:01
 * desc:
 */
public class AccountConst {

    public static String phone = "";
    public static String password = "";
    public static String token = "";

    /************** 功能作为model的时候外部调用 **************/
    public static void setAccountData(String mPhone, String mPassword, String mToken) {
        phone = mPhone;
        password = mPassword;
        token = mToken;
    }

    /************** 下面的功能作为application的时候自己调用 **************/
    public static void saveAccountData(Context context, String mPhone, String mPassword, String mToken) {
        SPUtil.put(context, "phone", mPhone);
        SPUtil.put(context, "password", mPassword);
        SPUtil.put(context, "token", mToken);
        phone = mPhone;
        password = mPassword;
        token = mToken;
    }

    public static void getAccountData(Context context) {
        phone = (String) SPUtil.get(context, "phone", "");
        password = (String) SPUtil.get(context, "password", "");
        token = (String) SPUtil.get(context, "token", "");
    }
}
